Data protection for a data storage device

ABSTRACT

Managing data stored in a Data Storage Device (DSD) including a plurality of disk surfaces for storing data. Head mapping information is received from the DSD associating addresses for data with different disk surfaces of the plurality of disk surfaces, and data is stored on a first disk surface of the plurality of disk surfaces. Redundant data for the data stored on the first disk surface is stored on a second disk surface of the plurality of disk surfaces using the head mapping information.

BACKGROUND

Data Storage Devices (DSDs) are often used to record data onto or to reproduce data from a storage media. One type of storage media includes a rotating magnetic disk where a magnetic head of the DSD can read and write data in tracks on a surface of the disk, such as in a Hard Disk Drive (HDD). After writing data on the disk surface, errors may be encountered when trying to access the data written on the disk surface. The errors can be caused by, for example, portions of the disk surface or the head becoming defective, or by more transient causes such as an interruption when writing the data on the disk surface (e.g., a write splice).

Although redundancy schemes exist for protecting data when one or more HDDs in an array of HDDs fail, such as in a Redundant Array of Independent Disks (RAID), these schemes require multiple HDDs. This type of data redundancy may be impractical in applications such as notebook computing. Thus, there is a need to provide for data redundancy within a single DSD.

BRIEF DESCRIPTION OF THE DRAWINGS

The features and advantages of the embodiments of the present disclosure will become more apparent from the detailed description set forth below when taken in conjunction with the drawings. The drawings and the associated descriptions are provided to illustrate embodiments of the disclosure and not to limit the scope of what is claimed.

FIG. 1 is a block diagram depicting a system with a Data Storage Device (DSD) according to an embodiment.

FIG. 2 is a block diagram depicting the DSD of FIG. 1 according to an embodiment.

FIG. 3 is a conceptual diagram providing an example of head mapping information according to an embodiment.

FIG. 4 is a flowchart for a data protection process according to an embodiment.

FIG. 5A is a sequence diagram for a mirroring data protection process according to an embodiment.

FIG. 5B is a sequence diagram for a mirroring data protection process according to another embodiment.

FIG. 6A is a sequence diagram for a parity data protection process according to an embodiment.

FIG. 6B is a sequence diagram for a parity data protection process according to another embodiment.

FIG. 7A is a sequence diagram for an error handling process according to an embodiment.

FIG. 7B is a sequence diagram for an error handling process according to another embodiment.

DETAILED DESCRIPTION

In the following detailed description, numerous specific details are set forth to provide a full understanding of the present disclosure. It will be apparent, however, to one of ordinary skill in the art that the various embodiments disclosed may be practiced without some of these specific details. In other instances, well-known structures and techniques have not been shown in detail to avoid unnecessarily obscuring the various embodiments.

System Overview

FIG. 1 shows system 100 according to an embodiment which includes host 101, input device 102, display device 104 and Data Storage Device (DSD) 106. System 100 can be, for example, a computer system (e.g., server, desktop, mobile/laptop, tablet, smartphone, etc.) or other electronic device such as a Digital Video Recorder (DVR). In this regard, system 100 may be a stand-alone system or part of a network, such as network 50, which can, for example, be a local or wide area network, or the Internet.

Those of ordinary skill in the art will appreciate that system 100 can include more or less than those elements shown in FIG. 1 and that the disclosed processes can be implemented in other environments

Input device 102 can be a keyboard, scroll wheel, or pointing device allowing a user of system 100 to enter information and commands to system 100, or to allow a user to manipulate objects displayed on display device 104. In other embodiments, input device 102 and display device 104 can be combined into a single component, such as a touch-screen that displays objects and receives user input.

In the embodiment of FIG. 1, host 101 includes Central Processing Unit (CPU) 108 which can be implemented using one or more processors for executing instructions including a microcontroller, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA), hard-wired logic, analog circuitry and/or a combination thereof. A processor of host 101 as referenced hereinafter can be one or more of the foregoing processors or another processor configured to perform functions described herein. CPU 108 interfaces with host bus 112. Also interfacing with host bus 112 are Random Access Memory (RAM) 110, input interface 115 for input device 102, display interface 116 for display device 104, Read Only Memory (ROM) 118, network interface 111, and data storage interface 119 for DSD 106.

RAM 110 represents a volatile memory of host 101 that interfaces with host bus 112 to provide information stored in RAM 110 to CPU 108 during execution of instructions in software programs such as DSD driver 12. More specifically, CPU 108 first loads computer-executable instructions from DSD 106 into a region of RAM 110. CPU 108 can then execute the stored process instructions from RAM 110. Data such as Head Mapping (HM) information 16 or data to be stored in or retrieved from DSD 106 can also be stored in RAM 110 so that the data can be accessed by CPU 108 during execution of software programs to the extent that such software programs have a need to access and/or modify the data.

As shown in FIG. 1, RAM 110 can be configured to store DSD driver 12 and HM information 16. DSD driver 12 provides a software interface for DSD 106 on host 101, and can cause CPU 108 to perform some of the processes discussed below.

HM information 16 can associate addresses for data with different disk surfaces of DSD 106 where the data is assigned for storage. In other words, HM information 16 can be used to indicate which disk surfaces are assigned to store data associated with different addresses. HM information 16 is described in more detail with reference to FIG. 3 below.

In some embodiments, the processes discussed below can be performed by a controller of DSD 106 (e.g., controller 120 of FIG. 2) by executing DSD firmware 14, which can include computer-executable instructions that control operation of DSD 106 when executed by the controller. DSD firmware 14 or portions thereof can be temporarily stored in a volatile memory of DSD 106 (e.g., volatile memory 140 in FIG. 2) for execution. In addition, DSD firmware 14 can be stored in a non-volatile memory of DSD 106 (e.g., disk 131 or disk 133 in FIG. 2). The processes may also be performed by CPU 108.

Data storage interface 119 is configured to interface host 101 with DSD 106, and can interface according to a Serial Advanced Technology Attachment (SATA) standard. In other embodiments, data storage interface 119 can interface with DSD 106 using other standards such as, for example, PCI express (PCIe) or Serial Attached SCSI (SAS).

FIG. 2 depicts a block diagram of DSD 106 according to an embodiment where DSD 106 includes Non-Volatile Memory (NVM) in the form of rotating magnetic disks 131 and 133. In other embodiments, DSD 106 may include a different number of disks or a different type of NVM such as a solid-state memory in addition to rotating magnetic disks.

DSD 106 includes controller 120 which includes circuitry such as one or more processors for executing instructions and can include a microcontroller, a DSP, an ASIC, an FPGA, hard-wired logic, analog circuitry and/or a combination thereof. In one implementation, controller 120 can include a system on a chip (SoC).

Host interface 126 is configured to interface DSD 106 with host 101 and may interface according to a standard such as, for example, PCIe, SATA, or SAS. As will be appreciated by those of ordinary skill in the art, host interface 126 can be included as part of controller 120. Although FIGS. 1 and 2 depict the co-location of host 101 and DSD 106, in other embodiments the two need not be physically co-located. In such embodiments, DSD 106 may be located remotely from host 101 and connected to host 101 via a network interface.

In the example of FIG. 2, disks 131 and 133 are rotated by a spindle motor (not shown) and heads 154, 156, 158, and 160 are positioned to read and write data on a corresponding disk surface of disks 131 or 133. Each of disk surfaces 134, 136, 138, and 142 includes a number of radially spaced, concentric tracks for storing data. In more detail, heads 154, 156, 158, and 160 are connected to the distal end of actuator 130 which is rotated by Voice Coil Motor (VCM) 132 to position heads 154, 156, 158, and 160 over tracks on disk surfaces 134, 136, 138, and 142, respectively. Controller 120 can include servo control circuitry (not shown) to control the rotation of disks 131 and 133, and control the position of the heads using VCM control signal 30.

Each of disk surfaces 134, 136, 138, and 142 includes a reserved area for storing redundant data for data written on other disk surfaces. As discussed in more detail below, the redundant data can include a copy of data written on another disk surface or parity data that can be used to reconstruct data written on another disk surface.

In the example of FIG. 2, reserved areas 146, 148, 150, and 152 are located near a central axis of disks 131 and 133 in an Inside Diameter (ID) portion of disks 131 and 133, since the ID portion is typically associated with a slower access time than other portions of the disk closer to the Outside Diameter (OD). The reserved areas may be located in an ID portion since the copies stored in the reserved areas may only be accessed when there is an error in accessing the primary data from a different disk surface. In other embodiments, one or more of reserved areas 146, 148, 150, and 152 may be located in a different portion of disks 131 and 133.

In FIG. 2, DSD 106 also includes volatile memory 140. Volatile memory 140 can include, for example, a Dynamic Random Access Memory (DRAM) which can be used by DSD 106 to temporarily store data. Data stored in volatile memory 140 can include data read from disks 131 and 133, data to be written to NVM, instructions loaded from firmware for execution by controller 120, and/or data used in executing firmware.

As shown in FIG. 2, volatile memory 140 is configured to store DSD firmware 14 and HM information 16. As discussed in more detail below, HM information 16 stored in RAM 110 of host 101 can be a copy of, or some derivative of, HM information 16 stored in volatile memory 140 of DSD 106. HM information 16 can indicate which disk surface stores data associated with a particular logical address.

In operation, host interface 126 receives host read and write commands from host 101 via host interface 126 for reading data from and writing data to NVM. In response to a write command from host 101, controller 120 may buffer the data to be written for the write command in volatile memory 140.

For data to be written on disk 131 or disk 133, a read/write channel (not shown) of controller 120 may then encode the buffered data into write signal 32 which is provided to a head for magnetically writing data to a corresponding disk surface.

In response to a read command for data stored on disk 131 or disk 133, controller 120 controls a head to magnetically read data stored on the disk surface and to send the read data as read signal 32. A read/write channel of controller 120 can then decode and buffer the data into volatile memory 140 for transmission to host 101 via host interface 126.

Data Protection Examples

FIG. 3 is a conceptual diagram providing an example of HM information 16 according to an embodiment. As shown in FIG. 3, HM information 16 includes entries for each of heads 154, 156, 158, and 160. The entries in the example of FIG. 3 associate addresses for data with different disk surfaces. More specifically, each of the entries includes pools of used Logical Block Addresses (LBAs) and pools of unused LBAs for each associated disk surface. The LBAs can be an addressing scheme used by host 101 for organizing and referring to data.

The pools of used LBAs, such as A, E, and I for head 154, can correspond to areas of disk surface 134 that have user data or data used by host 101 that is already stored on the disk surface. The pools of unused LBAs, such as M, Q, and U for head 154 can correspond to areas of disk surface 134 that do not yet have user data or data used by host 101 that is already stored on the disk surface. The pools of used or unused LBAs may include ranges of LBAs which can be specified, for example, with a starting LBA and a length. In addition, the length of such address ranges may differ depending upon the usage of the disk surfaces.

As discussed in more detail below, by using HM information 16 to identify the addresses assigned to each disk surface, it is ordinarily possible to identify available/unused space on disk surfaces and store redundant data on a different disk surface so as to protect the data stored in DSD 106. By storing the redundant data on a different disk surface, the data can ordinarily be protected against disk surface irregularities and possible problems that may occur with a particular head. This can generally improve the ability to recover important user files that may have otherwise been lost.

In addition, since a significant portion of disk surfaces typically remain unused in the average DSD, the storing of redundant data can be more routinely performed as a background activity to improve the perceived reliability of DSD 106 to a user of host 101. This can result in reduced warranty costs or returns of the DSD. For example, if most users only end up using half of the available data capacity of a DSD, the unused half of the DSD's data capacity can be reserved to store redundant data as user data is stored in the DSD. As DSD 106 approaches becoming half full, host 101 can then free up portions of the reserved areas and prioritize which data will have redundant data stored in DSD 106.

FIG. 4 is a flowchart for a data protection process that can be performed by CPU 108 of host 101 when executing DSD driver 12 according to an embodiment. In block 402, CPU 108 receives head mapping information 16 from DSD 106 via data storage interface 119. As discussed above, head mapping information 16 can associate LBAs for data with different disk surfaces or heads of DSD 106. The head mapping information may also indicate certain pools of used and unused LBAs for each disk surface.

In block 404, CPU 108 sends at least one write command to DSD 106 via data storage interface 119 to store data on a first disk surface of DSD 106 and to store corresponding redundant data on a second disk surface using head mapping information 16. In this regard, CPU 108 may send a first write command to store the data and then send a second write command to store the redundant data. In other embodiments, CPU 108 may send one write command for storing both the data and the redundant data.

In more detail, CPU 108 can identify an unused portion of the second disk surface based on head mapping information 16. In one implementation, an unused pool of LBAs may be provided from DSD 106 as part of head mapping information 16, as in the example of HM information 16 in FIG. 3. In another implementation, CPU 108 may identify LBAs for a particular disk surface using head mapping information 16 and then determine an unused portion of the LBAs for storing the redundant data with the use of DSD driver 12. In some implementations, DSD driver 12 can be used to monitor file system access to DSD 106 including a file type for accessed data, file LBA mapping, and used versus unused LBAs. In this regard, host 101 may also use a file system to assign LBAs to hidden files reserved for storing redundant data thereby determining reserved areas 146, 148, 150, and 152 for storing redundant data.

As noted above, the redundant data can include a copy of the data to provide data mirroring within DSD 106 or the redundant data can include parity data that can allow for reconstruction of the data using the parity data and data stored or to be stored on a third disk surface. The sequence diagrams of FIGS. 5A, 5B, 6A, and 6B discussed below provide example embodiments using either a copy of the data or parity data as the redundant data.

FIG. 5A is a sequence diagram for a mirroring data protection process according to an embodiment that can be performed by CPU 108 of host 101 executing DSD driver 12 and by controller 120 of DSD 106 executing DSD firmware 14. As shown in FIG. 5A, host 101 sends DSD 106 a request for head mapping information. This request can be performed upon an initial connection between host 101 and DSD 106. In other embodiments, the request for head mapping information can be omitted and DSD 106 may send HM information 16 to host 101 without a request. DSD 106 then sends head mapping information 16 to host 101 via host interface 126.

Host 101 determines reserved areas of DSD 106 for storing redundant data based on the head mapping information 16 received from DSD 106. In more detail, a file system of host 101 may assign unused LBAs for different disk surfaces to hidden files to determine the reserved areas.

Host 101 then sends a first write command to DSD 106 to store data on a first disk surface of DSD 106. More specifically, CPU 108 can send the first write command indicating at least one LBA for storing the data on the first disk surface. In response, controller 120 controls a first head (e.g., head 154) to write the data for the write command on a first disk surface (e.g., disk surface 134).

In the embodiment of FIG. 5A, CPU 108 determines whether to store a copy of the data on a second disk surface based on a predetermined criterion or an available data capacity of DSD 106. In one implementation, CPU 108 compares priority information for the data of the write command with predetermined criterion to determine whether to store a copy of the data from the first write command. In such implementations, the priority information can include at least one of a file type for the data, a directory location for the data, and a history of access for the data. For example, DSD driver 12 may identify a particular file type of the data as having a high or low priority and then determine to store a copy of the data on the second disk surface only if the file type indicates a high priority. In this example, the predetermined criterion can include a list of high priority file types that should have redundant data stored in DSD 106.

In another example, a particular directory location of the data such as files located in a “My Documents” folder, may indicate that a copy should be stored on the second disk surface. In this example, the predetermined criterion can allow for redundant data to be stored for data from particular folders.

In yet another example, DSD driver 12 may monitor the access to particular files such that the priority information indicates a level or frequency of access of the data. In such an example, the predetermined criterion can include a certain minimum number of accesses within a predetermined time period.

CPU 108 may also adjust the predetermined criterion based on a remaining available data capacity of one or more disk surfaces of DSD 106. For example, the criterion may be heightened as the available data capacity of DSD 106 decreases. In the examples discussed above, a certain file type or directory location may no longer correspond to a high priority such that redundant data is not stored for such file types or directory locations. A minimum level or frequency of access can be increased such that data will need to be accessed more frequently in order to have redundant data stored for it. Along these lines, DSD driver 12 may also provide a user interface to allow a user of host 101 to adjust the predetermined criterion used to determine which data should have redundant data.

In the example of FIG. 5A, CPU 108 can determine whether to send the second write command to store the copy based on whether a remaining available data capacity of one or more disk surfaces of DSD 106 is greater than a threshold data capacity. For example, host 101 may initially send a second write command to store copies for all data, but as the available data capacity of DSD 106 decreases, host 101 may become more selective about which data will have a copy. In one implementation, a file system of host 101 can reassign some of the unused addresses for reserved areas 146, 148, 150, and 152 when a threshold data capacity is reached to allow for more data to be stored in DSD 106. In this regard, the file system may create hidden files that serve as placeholders for the reserved areas and are not visible to a user of host 101. As the remaining available data capacity of DSD 106 decreases, host 101 may decrease the size of the hidden files to allow for more data to be stored in DSD 106. After reassigning addresses for the reserved areas, DSD driver 12 can update head mapping information 16 to reflect the new reserved areas of unused addresses.

CPU 108 can determine a portion of a reserved area for storing the copy using head mapping information 16 or a hidden file that has been assigned for the reserved area. In this way, CPU 108 can identify at least one unused address associated with the second disk surface for storing the copy of the data. The copy of the data may also be compressed by CPU 108 before sending a second write command to DSD 106 for storing the copy. In other embodiments, the copy may be compressed by controller 120 of DSD 106 before storing the compressed copy.

The second write command can then be sent via data storage interface 119 and indicate at least one address for storing the copy on the second disk surface. For example, with reference to head mapping information 16 in FIG. 3, CPU 108 may identify unused LBAs within pool O (associated with head 158 which writes on disk surface 138 in FIG. 2) for storing a copy of data addressed with LBAs from pool A (associated with head 154 which writes on disk surface 134 in FIG. 2) of used LBAs. The copy of data stored from the first write command on disk surface 134 by head 154 is then stored in reserved area 150 on disk surface 138 by head 158. By having access to head mapping information 16, host 101 can assign addresses to the redundant data so that it is stored on a different disk surface than the data sent for the first write command.

For its part, controller 120 of DSD 106 receives the second write command via host interface 126 and controls a second head (e.g., head 158) to write the copy of the data on the second disk surface (e.g., disk surface 138). As discussed above, in some embodiments, CPU 108 may send one command to effect the writes of the data and the copy of the data to the two disk surfaces.

FIG. 5B is a sequence diagram for a different mirroring data protection process according to an embodiment that can be performed by CPU 108 of host 101 executing DSD driver 12 and by controller 120 of DSD 106 executing DSD firmware 14. The sequence of FIG. 5B differs from that of FIG. 5A in that controller 120 of DSD 106 determines whether and where to store a copy of the data rather than CPU 108 of host 101.

As with the sequence of FIG. 5A, host 101 sends DSD 106 a request for head mapping information and DSD 106 sends head mapping information 16 to host 101 via host interface 126. Host 101 also determines reserved areas of DSD 106 for storing redundant data based on the head mapping information 16 received from DSD 106. Unlike the sequence of FIG. 5A, host 101 sends reserved area information back to DSD 106 to identify the reserved areas on each of the disk surfaces of DSD 106. In one implementation, the reserved area information can include logical address ranges for the reserved areas.

Host 101 then sends a write command to DSD 106 to store data on a first disk surface of DSD 106. In response, controller 120 controls a first head (e.g., head 154) to write the data for the write command on a first disk surface (e.g., disk surface 134).

In the embodiment of FIG. 5B, controller 120 determines whether to store a copy of the data on a second disk surface based on a predetermined criterion or an available data capacity of DSD 106. In one implementation, controller 120 compares priority information for the data of the write command with predetermined criterion to determine whether to store a copy of the data from the first write command. In such implementations, the priority information can be received from host 101 as part of a hinting provided by host 101 as to a priority level of the data. In other implementations, controller 120 may learn access patterns for the data and compare the access patterns to a predetermined criterion. In such an example, the predetermined criterion can include a certain minimum number of accesses within a predetermined time period.

Controller 120 may also adjust the predetermined criterion based on a remaining available data capacity of one or more disk surfaces of DSD 106. For example, the predetermined criterion may be heightened as the available data capacity of DSD 106 decreases. In the examples discussed above, a certain priority level for the data or a minimum level or frequency of access can be increased such that data will need to have a higher priority level or be accessed more frequently in order to have redundant data stored for it.

In the example of FIG. 5B, controller 120 can also or alternatively determine whether to write a copy of the data based on a remaining available data capacity of one or more disk surfaces. For example, controller 120 may initially write copies for all data, but as the available data capacity of DSD 106 decreases, controller 120 may become more selective about which data will have a copy.

Controller 120 can use the reserved area information received from host 101 to determine a portion of a reserved area for storing the copy. Specifically, controller 120 may identify at least one unused address associated with the second disk surface for storing the copy of the data. The copy of the data may also be compressed by controller 120 before writing it to the second disk surface. Controller 120 then controls a second head (e.g., head 158) to write the copy of the data on the second disk surface (e.g., disk surface 138).

FIG. 6A is a sequence diagram for a parity data protection process that can be performed by CPU 108 executing DSD driver 12 and by controller 120 executing DSD firmware 114 according to an embodiment. The sequence of FIG. 6A differs from the sequences of FIGS. 5A and 5B in that the redundant data is parity data that can be used to reconstruct the data for the first write command rather than a copy of the data. As shown in FIG. 6A, host 101 sends DSD 106 a request for head mapping information. This request can be performed upon an initial connection between host 101 and DSD 106. In other embodiments, the request for head mapping information can be omitted and DSD 106 may send HM information 16 to host 101 without a request. CPU 108 of host 101 then determines reserved areas of DSD 106 for storing redundant data.

Host 101 sends a first write command to DSD 106 to store data on a first disk surface of DSD 106. More specifically, CPU 108 sends the first write command via data storage interface 119 to indicate at least one LBA for storing the data. In response, controller 120 controls a first head (e.g., head 154) to write the data for the write command on the first disk surface (e.g., disk surface 134).

In some implementations, CPU 108 compares priority information for the data of the write command with a predetermined criterion to determine whether to store parity data for the data from the first write command. As in the example of FIG. 5A, the priority information can include at least one of a file type for the data, a directory location for the data, and a history of access for the data. The predetermined criterion can also be adjusted by host 101 based on a remaining available data capacity one or more disk surfaces of DSD 106. In some implementations, DSD driver 12 may also provide a user interface to allow a user of host 101 to adjust the predetermined criterion used to determine whether to store redundant data.

In the example of FIG. 6A, CPU 108 can determine whether to send a write command to store the parity data based on the comparison with the predetermined criterion or based on a remaining available data capacity of one or more disk surfaces of DSD 106. In this regard, less redundant data may be stored in DSD 106 as the available data capacity decreases. In one implementation, a file system of host 101 can reassign some of the unused addresses previously assigned for reserved areas 146, 148, 150, and 152, and update head mapping information 16 accordingly.

If it is determined to store parity data, CPU 108 determines a portion of a reserved area for storing the parity data. CPU 108 can determine the portion of the reserved area using head mapping information 16 or a hidden file that has been assigned for the reserved area. In this way, CPU 108 can identify at least one unused address associated with the second disk surface for storing the parity data.

CPU 108 calculates the parity data if it is determined to store the parity data. To calculate the parity data, CPU 108 may need to read data of the same size from one or more disk surfaces of DSD 106 other than the first disk surface and/or use other data of the same size to be stored in DSD 106 in a location other than the first disk surface. In one example, CPU 108 may calculate the parity data by performing an XOR operation on the data from the first write command and data stored on a third disk surface (e.g., disk surface 142).

If data needs to be read from DSD 106 to calculate the parity data, CPU 108 sends a read command for such data and controller 120 controls a head other than the first head to read the requested data. The data for calculating the parity data is then received by host 101 from DSD 106.

CPU 108 may also use head mapping information 16 to identify data stored on or to be stored on a particular disk surface that is used to calculate the parity data. With reference to the example of head mapping information 16 provided in FIG. 3, CPU 108 may identify N as an unused pool of LBAs for assigning to parity data generated by data addressed within used LBA pools A and C. With access to head mapping information 16, host 101 is able to assign LBAs to any unwritten data used to calculate the parity data and to assign LBAs to the parity data such that the parity data can be stored on a different disk surface than the data used to calculate the parity data. Either the data stored on the first disk surface or the other data used to calculate the parity data can then be reconstructed if needed using the parity data.

If using unwritten data to calculate the parity data, CPU 108 may send a write command to store any unwritten data that was used to calculate the parity data. Controller 120 of DSD 106 then receives the write command for the unwritten data and controls a third head to write the unwritten data on a third disk surface.

CPU 108 may also optionally compress the parity data before sending the parity data in a write command for storing the parity data on a second disk surface. In other implementations, the parity data may be compressed by controller 120 of DSD 106 before storing the parity data. The write command for the parity data is sent using data storage interface 119 to indicate at least one unused LBA for storing the parity data. For its part, controller 120 of DSD 106 receives the write command via host interface 126 and controls a second head (e.g., head 158) to write the parity data on the second disk surface (e.g., disk surface 138).

FIG. 6B is a sequence diagram for a parity data protection process that can be performed by CPU 108 executing DSD driver 12 and by controller 120 executing DSD firmware 114 according to an embodiment. The sequence of FIG. 6B differs from the sequence of FIG. 6A in that controller 120 of DSD 106 determines whether and where to store the parity data rather than CPU 108 of host 101. In addition, controller 120 calculates the parity data in FIG. 6B.

As with the sequence of FIG. 6A, host 101 sends DSD 106 a request for head mapping information. This request can be performed upon an initial connection between host 101 and DSD 106. In other embodiments, the request for head mapping information can be omitted and DSD 106 may send HM information 16 to host 101 without a request. CPU 108 of host 101 then determines reserved areas of DSD 106 for storing redundant data. Unlike the sequence of FIG. 6A, host 101 sends reserved area information back to DSD 106 to identify the reserved areas on each of the disk surfaces of DSD 106. In one implementation, the reserved area information can include logical address ranges for the reserved areas.

Host 101 sends a first write command to DSD 106 to store data on a first disk surface of DSD 106. In response, controller 120 controls a first head (e.g., head 154) to write the data for the write command on the first disk surface (e.g., disk surface 134).

In the embodiment of FIG. 6B, controller 120 determines whether to store parity data on a second disk surface based on a predetermined criterion or an available data capacity of DSD 106. In one implementation, controller 120 compares priority information for the data of the write command with a predetermined criterion to determine whether to store parity data. In such implementations, the priority information can be received from host 101 as part of a hinting provided by host 101 as to a priority level of the data. In other implementations, controller 120 may learn access patterns for the data and compare the access patterns to a predetermined criterion. In such an example, the predetermined criterion can include a certain minimum number of accesses within a predetermined time period.

Controller 120 may also adjust the predetermined criterion based on a remaining available data capacity of one or more disk surfaces of DSD 106. For example, the predetermined criterion may be heightened as the available data capacity of DSD 106 decreases. In the examples discussed above, a certain priority level for the data or a minimum level or frequency of access can be increased such that data will need to have a higher priority level or be accessed more frequently in order to have redundant data stored for it.

In the example of FIG. 6B, controller 120 can also or alternatively determine whether to write the parity data based on a remaining available data capacity of one or more disk surfaces. For example, controller 120 may initially write parity data for all data, but as the available data capacity of DSD 106 decreases, controller 120 may become more selective about which data will have parity data.

If it is determined to store parity data, controller 120 determines a portion of a reserved area for storing the parity data. Controller 120 can determine the portion of the reserved area using the reserved information received from host 101. In this way, controller 120 can identify at least one unused address associated with the reserved area of the second disk surface for storing the parity data.

Controller 120 calculates the parity data if it is determined to store the parity data and optionally compresses the parity data before storing it. To calculate the parity data, controller 120 reads data of the same size from one or more disk surfaces other than the first disk surface. In one example, controller 120 may calculate the parity data by performing an XOR operation on the data from the first write command and data stored on a third disk surface (e.g., disk surface 142).

Controller 120 may also use head mapping information 16 to identify data stored on a particular disk surface that is used to calculate the parity data. To write the parity data, controller 120 controls a second head (e.g., head 158) to write the parity data on the second disk surface (e.g., disk surface 138). Either the data stored on the first disk surface or the other data used to calculate the parity data can then be reconstructed if needed using the parity data stored on the second disk surface.

FIG. 7A is a sequence diagram for an error handling process that can be performed by CPU 108 executing DSD driver 12 and by controller 120 executing DSD firmware 114 according to an embodiment. As shown in FIG. 7A, host 101 sends a read command to DSD 106 to access data from a first disk surface (e.g., disk surface 134) of DSD 106. In reading the data from the first disk surface, DSD 106 detects an error such that the data cannot be retrieved from the first disk surface. Controller 120 of DSD 106 sends an indication of the error, such as an error message, to host 101 via host interface 126. The indication of the error may or may not be reported to an Operating System (OS) of host 101. In one implementation, DSD driver 12 executing at host 101 may receive the indication of the error without reporting the error to the OS of host 101.

In response, CPU 108 using DSD driver 12 sends information to DSD 106 via data storage interface 119 to allow DSD 106 to access redundant data from a second disk surface (e.g., disk surface 138). The information provided to DSD 106 can, for example, include a vendor specific command for error handling or it can include a read command indicating an address assigned to the redundant data stored on the second disk surface.

Controller 120 then controls the second head (e.g., head 158) to read the redundant data from the second disk surface (e.g., disk surface 138), and sends the redundant data to host 101 via host interface 126. If the redundant data is a copy of the data stored on the first disk surface, DSD driver 12 executing on host 101 may satisfy the read command for the data from the first disk surface using the copy of the data. If the redundant data is parity data, DSD driver 12 may need to send one or more additional read commands to retrieve data from other disk surfaces to reconstruct the data stored on the first disk surface using the parity data. In one implementation, DSD driver 12 may cause CPU 108 to reconstruct the data from the first disk surface by performing an XOR operation with data from a third disk surface and the parity data from the second disk surface.

In the example sequence of FIG. 7A, host 101 attempts to restore the data in DSD 106 that could not be accessed from the first disk surface. In this regard, host 101 sends a write command to store the data on a disk surface other than the second disk surface using head mapping information 16 and a copy of the data read from the second surface or data reconstructed from parity data read from the second surface. Host 101 sends a write command to store the copy of the data or the reconstructed data onto a third or fourth disk surface. Controller 120 of DSD 106 can then control the corresponding head to write the copy of the data or the reconstructed data on a disk surface other than the second disk surface where the redundant data is stored.

FIG. 7B is a sequence diagram for a different error handling process that can be performed by controller 120 executing DSD firmware 114 according to an embodiment. The sequence of FIG. 7B differs from that of FIG. 7A in that controller 120 sends a copy of the data or a reconstructed copy of the data to host 101 without sending an indication of an error in accessing data from the first disk surface or without receiving additional information from host 101 on accessing the redundant data from the second disk surface.

As shown in FIG. 7B, host 101 sends a read command to DSD 106 to access data from a first disk surface (e.g., disk surface 134) of DSD 106. In reading the data from the first disk surface, DSD 106 detects an error such that the data cannot be retrieved from the first disk surface.

Controller 120 then controls a second head (e.g., head 158) to read a copy of the data from a second disk surface (e.g., disk surface 138) or parity data from the second disk surface. If a copy of the data is read, controller 120 sends the copy to host 101 via host interface 126. If parity data is read from the second surface, controller 120 can use the parity data and other data stored in DSD 106 to reconstruct the data stored on the first disk surface before sending the reconstructed data to host 101 via host interface 126.

In the example sequence of FIG. 7B, host 101 attempts to restore the data in DSD 106 that could not be accessed from the first disk surface. Specifically, controller 120 restores the data by controlling a head other than the second head to write a copy of the data or reconstructed data on a disk surface other than the second disk surface where the redundant data is stored.

By storing redundant data on a different disk surface as in the processes discussed above, it is ordinarily possible to protect data stored within a single DSD from problems with a particular disk surface or head. Such redundancy can allow for improved reliability of the DSD.

OTHER EMBODIMENTS

Those of ordinary skill in the art will appreciate that the various illustrative logical blocks, modules, and processes described in connection with the examples disclosed herein may be implemented as electronic hardware, computer software, or combinations of both. Furthermore, the foregoing processes can be embodied on a computer readable medium which causes a processor or computer to perform or execute certain functions.

To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, and modules have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Those of ordinary skill in the art may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.

The various illustrative logical blocks, units, modules, and controllers described in connection with the examples disclosed herein may be implemented or performed with a general purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination thereof designed to perform the functions described herein. A general purpose processor may be a microprocessor, but in the alternative, the processor may be any conventional processor, controller, microcontroller, or state machine. A processor may also be implemented as a combination of computing devices, e.g., a combination of a DSP and a microprocessor, a plurality of microprocessors, one or more microprocessors in conjunction with a DSP core, or any other such configuration.

The activities of a method or process described in connection with the examples disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The steps of the method or algorithm may also be performed in an alternate order from those provided in the examples. A software module may reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable media, an optical media, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium may be integral to the processor. The processor and the storage medium may reside in an Application Specific Integrated Circuit (ASIC).

The foregoing description of the disclosed example embodiments is provided to enable any person of ordinary skill in the art to make or use the embodiments in the present disclosure. Various modifications to these examples will be readily apparent to those of ordinary skill in the art, and the principles disclosed herein may be applied to other examples without departing from the spirit or scope of the present disclosure. The described embodiments are to be considered in all respects only as illustrative and not restrictive and the scope of the disclosure is, therefore, indicated by the following claims rather than by the foregoing description. All changes which come within the meaning and range of equivalency of the claims are to be embraced within their scope. 

What is claimed is:
 1. A host, comprising: an interface for communicating with a Data Storage Device (DSD) including a plurality of disk surfaces for storing data; and a processor configured to: receive head mapping information from the DSD using the interface, the head mapping information associating addresses for data with different disk surfaces of the plurality of disk surfaces; and send at least one write command to the DSD using the interface to store data on a first disk surface of the plurality of disk surfaces and to store corresponding redundant data on a second disk surface of the plurality of disk surfaces using the head mapping information.
 2. The host of claim 1, wherein the processor is further configured to determine whether to store the redundant data on the second disk surface based on comparing priority information for the data with a predetermined criterion.
 3. The host of claim 2, wherein the priority information includes at least one of a file type for the data, a directory location for the data, and a history of access for the data.
 4. The host of claim 2, wherein the processor is further configured to adjust the predetermined criterion based on a remaining available data capacity of one or more of the plurality of disk surfaces.
 5. The host of claim 1, wherein the processor is further configured to determine whether to store the redundant data on the second disk surface based on an available data capacity of one or more of the plurality of disk surfaces.
 6. The host of claim 1, wherein the processor is further configured to determine using the head mapping information a reserved area of the second disk surface that is reserved for storing redundant data for data written on other disk surfaces of the plurality of disk surfaces.
 7. The host of claim 6, wherein the processor is further configured to adjust a size of the reserved area based on a remaining available data capacity of one or more of the plurality of disk surfaces.
 8. The host of claim 1, wherein the processor is further configured to compress the redundant data for storing on the second disk surface.
 9. The host of claim 1, wherein the processor is further configured to: receive an indication from the DSD via the interface indicating an error in accessing the data from the first disk surface; and send a read command to the DSD using the interface so that the DSD can use the redundant data on the second disk surface.
 10. The host of claim 1, wherein the redundant data is parity data that can be used to reconstruct the data written on the first disk surface or data stored or to be stored on a third disk surface of the plurality of disk surfaces.
 11. A Data Storage Device (DSD), comprising: a plurality of disk surfaces for storing data; a plurality of heads with each head of the plurality of heads configured to write data on and read data from a respective disk surface of the plurality of disk surfaces; an interface for communicating with a host; and a controller configured to: send, using the interface, head mapping information to the host, the head mapping information associating addresses for data with different disk surfaces of the plurality of disk surfaces; receive, using the interface, a write command from the host to store data on a first disk surface of the plurality of disk surfaces; control a first head of the plurality of heads to write the data of the write command on the first disk surface; and control a second head of the plurality of heads to write redundant data for the data of the write command on a second disk surface.
 12. The DSD of claim 11, wherein the redundant data is written in a reserved area of the second disk surface that is reserved for storing redundant data for data written on other disk surfaces of the plurality of disk surfaces.
 13. The DSD of claim 11, wherein the controller is further configured to compress the redundant data before controlling the second head to write the redundant data on the second disk surface.
 14. The DSD of claim 11, wherein the controller is further configured to: detect an error in accessing the data from the first disk surface; and control the second head to access the redundant data from the second disk surface.
 15. The DSD of claim 14, wherein the controller is further configured to: send an indication to the host via the interface indicating an error in accessing the data from the first disk surface; and receive a read command via the interface from the host to access the redundant data on the second disk surface.
 16. The DSD of claim 11, wherein the redundant data is parity data that can be used to reconstruct the data written on the first disk surface or data stored or to be stored on a third disk surface of the plurality of disk surfaces.
 17. The DSD of claim 11, wherein the controller is further configured to determine whether to write the redundant data on the second disk surface based on a predetermined criterion.
 18. The DSD of claim 17, wherein, in determining whether to write the redundant data on the second disk surface, the controller is further configured to compare priority information received from the host for the data with the predetermined criterion or compare access patterns for the data with the predetermined criterion.
 19. The DSD of claim 17, wherein the controller is further configured to adjust the predetermined criterion based on a remaining available data capacity of one or more of the plurality of disk surfaces.
 20. The DSD of claim 11, wherein the controller is further configured to determine whether to store the redundant data on the second disk surface based on an available data capacity of one or more of the plurality of disk surfaces.
 21. A method of managing data stored in a Data Storage Device (DSD) including a plurality of disk surfaces for storing data, the method comprising: receiving head mapping information from the DSD, the head mapping information associating addresses for data with different disk surfaces of the plurality of disk surfaces; storing data on a first disk surface of the plurality of disk surfaces; and storing redundant data for the data stored on the first disk surface, wherein the redundant data is stored on a second disk surface of the plurality of disk surfaces using the head mapping information.
 22. The method of claim 21, further comprising determining whether to store the redundant data on the second disk surface based on comparing priority information for the data stored on the first disk surface with a predetermined criterion.
 23. The method of claim 22, wherein the priority information includes at least one of a file type for the data, a directory location for the data, and a history of access for the data.
 24. The method of claim 22, further comprising adjusting the predetermined criterion based on a remaining available data capacity of one or more of the plurality of disk surfaces.
 25. The method of claim 21, further comprising determining whether to store the redundant data on the second disk surface based on an available data capacity of one or more of the plurality of disk surfaces.
 26. The method of claim 21, further comprising determining using the head mapping information a reserved area of the second disk surface that is reserved for storing redundant data for data written on other disk surfaces of the plurality of disk surfaces.
 27. The method of claim 26, further comprising adjusting a size of the reserved area based on a remaining available data capacity of one or more of the plurality of disk surfaces.
 28. The method of claim 21, further comprising compressing the redundant data before storing the compressed redundant data on the second disk surface.
 29. The method of claim 21, further comprising: receiving an indication from the DSD indicating an error in accessing the data from the first disk surface; and sending information to the DSD so that the DSD can use the redundant data on the second disk surface.
 30. The method of claim 21, wherein the redundant data is parity data that can be used to reconstruct the data written on the first disk surface or data stored or to be stored on a third disk surface of the plurality of disk surfaces.
 31. A non-transitory computer-readable medium storing computer executable instructions for managing data in a Data Storage Device (DSD) including a plurality of disk surfaces for storing data, wherein when the computer executable instructions are executed by a processor, the computer executable instructions cause the processor to: receive head mapping information from the DSD, the head mapping information associating addresses for data with different disk surfaces of the plurality of disk surfaces; store data on a first disk surface of the plurality of disk surfaces; and store redundant data for the data stored on the first disk surface, wherein the redundant data is stored on a second disk surface of the plurality of disk surfaces using the head mapping information. 